home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / cmds / cc / dist / optabs.c < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-13  |  61.7 KB  |  2,227 lines

  1. /* Expand the basic unary and binary arithmetic operations, for GNU compiler.
  2.    Copyright (C) 1987, 1988 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 1, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20.  
  21. #include "config.h"
  22. #include "rtl.h"
  23. #include "tree.h"
  24. #include "flags.h"
  25. #include "insn-flags.h"
  26. #include "insn-codes.h"
  27. #include "expr.h"
  28. #include "insn-config.h"
  29. #include "recog.h"
  30.  
  31. /* In ANSI C we could write MODE + 1, but traditional C compilers
  32.    seem to reject it.  */
  33. #define INC_MODE(MODE) (enum machine_mode) ((int)(MODE) + 1)
  34.  
  35. /* Each optab contains info on how this target machine
  36.    can perform a particular operation
  37.    for all sizes and kinds of operands.
  38.  
  39.    The operation to be performed is often specified
  40.    by passing one of these optabs as an argument.
  41.  
  42.    See expr.h for documentation of these optabs.  */
  43.  
  44. optab add_optab;
  45. optab sub_optab;
  46. optab smul_optab;
  47. optab umul_optab;
  48. optab smul_widen_optab;
  49. optab umul_widen_optab;
  50. optab sdiv_optab;
  51. optab sdivmod_optab;
  52. optab udiv_optab;
  53. optab udivmod_optab;
  54. optab smod_optab;
  55. optab umod_optab;
  56. optab flodiv_optab;
  57. optab ftrunc_optab;
  58. optab and_optab;
  59. optab andcb_optab;
  60. optab ior_optab;
  61. optab xor_optab;
  62. optab ashl_optab;
  63. optab lshr_optab;
  64. optab lshl_optab;
  65. optab ashr_optab;
  66. optab rotl_optab;
  67. optab rotr_optab;
  68.  
  69. optab mov_optab;
  70. optab movstrict_optab;
  71.  
  72. optab neg_optab;
  73. optab abs_optab;
  74. optab one_cmpl_optab;
  75. optab ffs_optab;
  76.  
  77. optab cmp_optab;
  78. optab ucmp_optab;  /* Used only for libcalls for unsigned comparisons.  */
  79. optab tst_optab;
  80.  
  81. /* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
  82.    gives the gen_function to make a branch to test that condition.  */
  83.  
  84. rtxfun bcc_gen_fctn[NUM_RTX_CODE];
  85.  
  86. /* Indexed by the rtx-code for a conditional (eg. EQ, LT,...)
  87.    gives the gen_function to make a store-condition insn
  88.    to test that condition.  */
  89.  
  90. rtxfun setcc_gen_fctn[NUM_RTX_CODE];
  91.  
  92. /* Generate code to perform an operation specified by BINOPTAB
  93.    on operands OP0 and OP1, with result having machine-mode MODE.
  94.  
  95.    UNSIGNEDP is for the case where we have to widen the operands
  96.    to perform the operation.  It says to use zero-extension.
  97.  
  98.    If TARGET is nonzero, the value
  99.    is generated there, if it is convenient to do so.
  100.    In all cases an rtx is returned for the locus of the value;
  101.    this may or may not be TARGET.  */
  102.  
  103. rtx
  104. expand_binop (mode, binoptab, op0, op1, target, unsignedp, methods)
  105.      enum machine_mode mode;
  106.      optab binoptab;
  107.      rtx op0, op1;
  108.      rtx target;
  109.      int unsignedp;
  110.      enum optab_methods methods;
  111. {
  112.   enum mode_class class;
  113.   enum machine_mode wider_mode;
  114.   register rtx temp;
  115.   rtx last;
  116.  
  117.   class = GET_MODE_CLASS (mode);
  118.  
  119.   op0 = protect_from_queue (op0, 0);
  120.   op1 = protect_from_queue (op1, 0);
  121.   if (target)
  122.     target = protect_from_queue (target, 1);
  123.  
  124. #if 0
  125.   /* We may get better code by generating the result in a register
  126.      when the target is not one of the operands.  */
  127.   if (target && ! rtx_equal_p (target, op1) && ! rtx_equal_p (target, op0))
  128.     target_is_not_an_operand = 1;
  129. #endif
  130.  
  131.   if (flag_force_mem)
  132.     {
  133.       op0 = force_not_mem (op0);
  134.       op1 = force_not_mem (op1);
  135.     }
  136.  
  137.   /* Record where to delete back to if we backtrack.  */
  138.   last = get_last_insn ();
  139.  
  140.   /* If operation is commutative,
  141.      try to make the first operand a register.
  142.      Even better, try to make it the same as the target.
  143.      Also try to make the last operand a constant.  */
  144.   if (binoptab == add_optab
  145.       || binoptab == and_optab
  146.       || binoptab == ior_optab
  147.       || binoptab == xor_optab
  148.       || binoptab == smul_optab
  149.       || binoptab == umul_optab
  150.       || binoptab == smul_widen_optab
  151.       || binoptab == umul_widen_optab)
  152.     {
  153.       if (((target == 0 || GET_CODE (target) == REG)
  154.        ? ((GET_CODE (op1) == REG
  155.            && GET_CODE (op0) != REG)
  156.           || target == op1)
  157.        : rtx_equal_p (op1, target))
  158.       ||
  159.       GET_CODE (op0) == CONST_INT)
  160.     {
  161.       temp = op1;
  162.       op1 = op0;
  163.       op0 = temp;
  164.     }
  165.     }
  166.  
  167.   /* If we can do it with a three-operand insn, do so.  */
  168.  
  169.   if (methods != OPTAB_MUST_WIDEN
  170.       && binoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  171.     {
  172.       int icode = (int) binoptab->handlers[(int) mode].insn_code;
  173.       enum machine_mode mode0 = insn_operand_mode[icode][1];
  174.       enum machine_mode mode1 = insn_operand_mode[icode][2];
  175.       rtx pat;
  176.       rtx xop0 = op0, xop1 = op1;
  177.  
  178.       if (target)
  179.     temp = target;
  180.       else
  181.     temp = gen_reg_rtx (mode);
  182.  
  183.       /* In case the insn wants input operands in modes different from
  184.      the result, convert the operands.  */
  185.  
  186.       if (GET_MODE (op0) != VOIDmode
  187.       && GET_MODE (op0) != mode0)
  188.     xop0 = convert_to_mode (mode0, xop0, unsignedp);
  189.  
  190.       if (GET_MODE (xop1) != VOIDmode
  191.       && GET_MODE (xop1) != mode1)
  192.     xop1 = convert_to_mode (mode1, xop1, unsignedp);
  193.  
  194.       /* Now, if insn requires register operands, put operands into regs.  */
  195.  
  196.       if (! (*insn_operand_predicate[icode][1]) (xop0, mode0))
  197.     xop0 = force_reg (mode0, xop0);
  198.  
  199.       if (! (*insn_operand_predicate[icode][2]) (xop1, mode1))
  200.     xop1 = force_reg (mode1, xop1);
  201.  
  202.       if (! (*insn_operand_predicate[icode][0]) (temp, mode))
  203.     temp = gen_reg_rtx (mode);
  204.  
  205.       pat = GEN_FCN (icode) (temp, xop0, xop1);
  206.       if (pat)
  207.     {
  208.       emit_insn (pat);
  209.       return temp;
  210.     }
  211.       else
  212.     delete_insns_since (last);
  213.     }
  214.  
  215.   /* It can't be open-coded in this mode.
  216.      Use a library call if one is available and caller says that's ok.  */
  217.  
  218.   if (binoptab->handlers[(int) mode].lib_call
  219.       && (methods == OPTAB_LIB || methods == OPTAB_LIB_WIDEN))
  220.     {
  221.       rtx insn_before, insn_first, insn_last;
  222.       rtx funexp = gen_rtx (SYMBOL_REF, Pmode,
  223.                 binoptab->handlers[(int) mode].lib_call);
  224.  
  225.       /* Pass the address through a pseudoreg, if desired,
  226.      before the "beginning" of the library call.
  227.      So this insn isn't "part of" the library call, in case that
  228.      is deleted, or cse'd.  */
  229. #ifndef NO_FUNCTION_CSE
  230.       if (! flag_no_function_cse)
  231.     funexp = copy_to_mode_reg (Pmode, funexp);
  232. #endif
  233.  
  234.       insn_before = get_last_insn ();
  235.       if (insn_before == 0)
  236.     abort ();
  237.  
  238.       /* Cannot pass FUNEXP since emit_library_call insists
  239.      on getting a SYMBOL_REF.  But cse will make this SYMBOL_REF
  240.      be replaced with the copy we made just above.  */
  241.       /* Pass 1 for NO_QUEUE so we don't lose any increments
  242.      if the libcall is cse'd or moved.  */
  243.       emit_library_call (gen_rtx (SYMBOL_REF, Pmode,
  244.                   binoptab->handlers[(int) mode].lib_call),
  245.              1, mode, 2, op0, mode, op1, mode);
  246.       target = hard_libcall_value (mode);
  247.       temp = copy_to_reg (target);
  248.  
  249.       insn_first = NEXT_INSN (insn_before);
  250.       insn_last = get_last_insn ();
  251.  
  252.       REG_NOTES (insn_last)
  253.     = gen_rtx (EXPR_LIST, REG_EQUAL,
  254.            gen_rtx (binoptab->code, mode, op0, op1),
  255.            gen_rtx (INSN_LIST, REG_RETVAL, insn_first,
  256.                 REG_NOTES (insn_last)));
  257.       REG_NOTES (insn_first)
  258.     = gen_rtx (INSN_LIST, REG_LIBCALL, insn_last,
  259.            REG_NOTES (insn_first));
  260.       return temp;
  261.     }
  262.  
  263.   delete_insns_since (last);
  264.  
  265.   /* It can't be done in this mode.  Can we do it in a wider mode?  */
  266.  
  267.   if (! (methods == OPTAB_WIDEN || methods == OPTAB_LIB_WIDEN
  268.      || methods == OPTAB_MUST_WIDEN))
  269.     return 0;            /* Caller says, don't even try.  */
  270.  
  271.   /* Compute the value of METHODS to pass to recursive calls.
  272.      Don't allow widening to be tried recursively.  */
  273.  
  274.   methods = (methods == OPTAB_LIB_WIDEN ? OPTAB_LIB : OPTAB_DIRECT);
  275.  
  276.   /* Widening is now independent of specific machine modes.
  277.      It is assumed that widening may be performed to any
  278.      higher numbered mode in the same mode class.  */
  279.  
  280.   if (class == MODE_INT || class == MODE_FLOAT)
  281.     {
  282.       for (wider_mode = INC_MODE (mode);
  283.        ((int) wider_mode < (int) MAX_MACHINE_MODE
  284.         && GET_MODE_CLASS (wider_mode) == class);
  285.        wider_mode = INC_MODE (wider_mode))
  286.     {
  287.       if ((binoptab->handlers[(int) wider_mode].insn_code
  288.            != CODE_FOR_nothing)
  289.           || (methods == OPTAB_LIB
  290.           && binoptab->handlers[(int) wider_mode].lib_call))
  291.         {
  292.           rtx xop0 = op0, xop1 = op1;
  293.           int no_extend = 0;
  294.  
  295.           /* For certain operations, we need not actually extend
  296.          the narrow operands, as long as we will truncate
  297.          the results to the same narrowness.  */
  298.  
  299.           if (binoptab == ior_optab || binoptab == and_optab
  300.           || binoptab == xor_optab || binoptab == andcb_optab
  301.           || binoptab == add_optab || binoptab == sub_optab
  302.           || binoptab == smul_optab || binoptab == umul_optab
  303.           || binoptab == ashl_optab || binoptab == lshl_optab)
  304.         no_extend = 1;
  305.  
  306.           if (GET_MODE (xop0) != VOIDmode)
  307.         {
  308.           if (no_extend)
  309.             {
  310.               temp = force_reg (GET_MODE (xop0), xop0);
  311.               xop0 = gen_rtx (SUBREG, wider_mode, temp, 0);
  312.             }
  313.           else
  314.             {
  315.               temp = gen_reg_rtx (wider_mode);
  316.               convert_move (temp, xop0, unsignedp);
  317.               xop0 = temp;
  318.             }
  319.         }
  320.           if (GET_MODE (xop1) != VOIDmode)
  321.         {
  322.           if (no_extend)
  323.             {
  324.               temp = force_reg (GET_MODE (xop1), xop1);
  325.               xop1 = gen_rtx (SUBREG, wider_mode, temp, 0);
  326.             }
  327.           else
  328.             {
  329.               temp = gen_reg_rtx (wider_mode);
  330.               convert_move (temp, xop1, unsignedp);
  331.               xop1 = temp;
  332.             }
  333.         }
  334.  
  335.           temp = expand_binop (wider_mode, binoptab, xop0, xop1, 0,
  336.                    unsignedp, methods);
  337.           if (temp)
  338.         {
  339.           if (class == MODE_FLOAT)
  340.             {
  341.               if (target == 0)
  342.             target = gen_reg_rtx (mode);
  343.               convert_move (target, temp, 0);
  344.               return target;
  345.             }
  346.           else
  347.             return gen_lowpart (mode, temp);
  348.         }
  349.           else
  350.         delete_insns_since (last);
  351.         }
  352.     }
  353.     }
  354.  
  355.   return 0;
  356. }
  357.  
  358. /* Expand a binary operator which has both signed and unsigned forms.
  359.    UOPTAB is the optab for unsigned operations, and SOPTAB is for
  360.    signed operations.
  361.  
  362.    If we widen unsigned operands, we may use a signed wider operation instead
  363.    of an unsigned wider operation, since the result would be the same.  */
  364.  
  365. rtx
  366. sign_expand_binop (mode, uoptab, soptab, op0, op1, target, unsignedp, methods)
  367.     enum machine_mode mode;
  368.     optab uoptab, soptab;
  369.     rtx op0, op1, target;
  370.     int unsignedp;
  371.     enum optab_methods methods;
  372. {
  373.   register rtx temp;
  374.   optab direct_optab = unsignedp ? uoptab : soptab;
  375.   struct optab wide_soptab;
  376.  
  377.   /* Do it without widening, if possible.  */
  378.   temp = expand_binop (mode, direct_optab, op0, op1, target,
  379.                unsignedp, OPTAB_DIRECT);
  380.   if (temp || methods == OPTAB_DIRECT)
  381.     return temp;
  382.  
  383.   /* Try widening to a signed int.  Make a fake signed optab that
  384.      hides any signed insn for direct use.  */
  385.   wide_soptab = *soptab;
  386.   wide_soptab.handlers[(int) mode].insn_code = CODE_FOR_nothing;
  387.   wide_soptab.handlers[(int) mode].lib_call = 0;
  388.  
  389.   temp = expand_binop (mode, &wide_soptab, op0, op1, target,
  390.                unsignedp, OPTAB_WIDEN);
  391.  
  392.   /* For unsigned operands, try widening to an unsigned int.  */
  393.   if (temp == 0 && unsignedp)
  394.     temp = expand_binop (mode, uoptab, op0, op1, target,
  395.              unsignedp, OPTAB_WIDEN);
  396.   if (temp || methods == OPTAB_WIDEN)
  397.     return temp;
  398.  
  399.   /* Use the right width lib call if that exists.  */
  400.   temp = expand_binop (mode, direct_optab, op0, op1, target, unsignedp, OPTAB_LIB);
  401.   if (temp || methods == OPTAB_LIB)
  402.     return temp;
  403.  
  404.   /* Must widen and use a lib call, use either signed or unsigned.  */
  405.   temp = expand_binop (mode, &wide_soptab, op0, op1, target,
  406.                unsignedp, methods);
  407.   if (temp != 0)
  408.     return temp;
  409.   if (unsignedp)
  410.     return expand_binop (mode, uoptab, op0, op1, target,
  411.              unsignedp, methods);
  412.   return 0;
  413. }
  414.  
  415. /* Generate code to perform an operation specified by BINOPTAB
  416.    on operands OP0 and OP1, with two results to TARG1 and TARG2.
  417.    We assume that the order of the operands for the instruction
  418.    is TARG0, OP0, OP1, TARG1, which would fit a pattern like
  419.    [(set TARG0 (operate OP0 OP1)) (set TARG1 (operate ...))].
  420.  
  421.    Either TARG0 or TARG1 may be zero, but what that means is that
  422.    that result is not actually wanted.  We will generate it into
  423.    a dummy pseudo-reg and discard it.  They may not both be zero.
  424.  
  425.    Returns 1 if this operation can be performed; 0 if not.  */
  426.  
  427. int
  428. expand_twoval_binop (binoptab, op0, op1, targ0, targ1, unsignedp)
  429.      optab binoptab;
  430.      rtx op0, op1;
  431.      rtx targ0, targ1;
  432.      int unsignedp;
  433. {
  434.   enum machine_mode mode = GET_MODE (targ0 ? targ0 : targ1);
  435.   enum mode_class class;
  436.   enum machine_mode wider_mode;
  437.  
  438.   class = GET_MODE_CLASS (mode);
  439.  
  440.   op0 = protect_from_queue (op0, 0);
  441.   op1 = protect_from_queue (op1, 0);
  442.  
  443.   if (flag_force_mem)
  444.     {
  445.       op0 = force_not_mem (op0);
  446.       op1 = force_not_mem (op1);
  447.     }
  448.  
  449.   if (targ0)
  450.     targ0 = protect_from_queue (targ0, 1);
  451.   else
  452.     targ0 = gen_reg_rtx (mode);
  453.   if (targ1)
  454.     targ1 = protect_from_queue (targ1, 1);
  455.   else
  456.     targ1 = gen_reg_rtx (mode);
  457.  
  458.   if (binoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  459.     {
  460.       emit_insn (GEN_FCN (binoptab->handlers[(int) mode].insn_code)
  461.          (targ0, op0, op1, targ1));
  462.       return 1;
  463.     }
  464.  
  465.   /* It can't be done in this mode.  Can we do it in a wider mode?  */
  466.  
  467.   if (class == MODE_INT || class == MODE_FLOAT)
  468.     {
  469.       for (wider_mode = INC_MODE (mode);
  470.        ((int) wider_mode < (int) MAX_MACHINE_MODE
  471.         && GET_MODE_CLASS (wider_mode) == class);
  472.        wider_mode = INC_MODE (wider_mode))
  473.     {
  474.       if (binoptab->handlers[(int) wider_mode].insn_code
  475.           != CODE_FOR_nothing)
  476.         {
  477.           expand_twoval_binop_convert (binoptab, wider_mode, op0, op1,
  478.                        targ0, targ1, unsignedp);
  479.           return 1;
  480.         }
  481.     }
  482.     }
  483.   return 0;
  484. }
  485.  
  486. int
  487. expand_twoval_binop_convert (binoptab, mode, op0, op1, targ0, targ1, unsignedp)
  488.      register optab binoptab;
  489.      register rtx op0, op1, targ0, targ1;
  490.      int unsignedp;
  491. {
  492.   register rtx t0 = gen_reg_rtx (SImode);
  493.   register rtx t1 = gen_reg_rtx (SImode);
  494.   register rtx temp;
  495.  
  496.   temp = gen_reg_rtx (SImode);
  497.   convert_move (temp, op0, unsignedp);
  498.   op0 = temp;
  499.   temp = gen_reg_rtx (SImode);
  500.   convert_move (temp, op1, unsignedp);
  501.   op1 = temp;
  502.  
  503.   expand_twoval_binop (binoptab, op0, op1, t0, t1, unsignedp);
  504.   convert_move (targ0, t0, unsignedp);
  505.   convert_move (targ1, t1, unsignedp);
  506.   return 1;
  507. }
  508.  
  509. /* Generate code to perform an operation specified by UNOPTAB
  510.    on operand OP0, with result having machine-mode MODE.
  511.  
  512.    UNSIGNEDP is for the case where we have to widen the operands
  513.    to perform the operation.  It says to use zero-extension.
  514.  
  515.    If TARGET is nonzero, the value
  516.    is generated there, if it is convenient to do so.
  517.    In all cases an rtx is returned for the locus of the value;
  518.    this may or may not be TARGET.  */
  519.  
  520. rtx
  521. expand_unop (mode, unoptab, op0, target, unsignedp)
  522.      enum machine_mode mode;
  523.      optab unoptab;
  524.      rtx op0;
  525.      rtx target;
  526.      int unsignedp;
  527. {
  528.   enum mode_class class;
  529.   enum machine_mode wider_mode;
  530.   register rtx temp;
  531.  
  532.   class = GET_MODE_CLASS (mode);
  533.  
  534.   op0 = protect_from_queue (op0, 0);
  535.  
  536.   if (flag_force_mem)
  537.     {
  538.       op0 = force_not_mem (op0);
  539.     }
  540.  
  541.   if (target)
  542.     target = protect_from_queue (target, 1);
  543.  
  544.   if (unoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  545.     {
  546.       int icode = (int) unoptab->handlers[(int) mode].insn_code;
  547.       enum machine_mode mode0 = insn_operand_mode[icode][1];
  548.  
  549.       if (target)
  550.     temp = target;
  551.       else
  552.     temp = gen_reg_rtx (mode);
  553.  
  554.       if (GET_MODE (op0) != VOIDmode
  555.       && GET_MODE (op0) != mode0)
  556.     op0 = convert_to_mode (mode0, op0, unsignedp);
  557.  
  558.       /* Now, if insn requires register operands, put operands into regs.  */
  559.  
  560.       if (! (*insn_operand_predicate[icode][1]) (op0, mode0))
  561.     op0 = force_reg (mode0, op0);
  562.  
  563.       if (! (*insn_operand_predicate[icode][0]) (temp, mode))
  564.     temp = gen_reg_rtx (mode);
  565.  
  566.       emit_insn (GEN_FCN (icode) (temp, op0));
  567.       return temp;
  568.     }
  569.   else if (unoptab->handlers[(int) mode].lib_call)
  570.     {
  571.       rtx insn_before, insn_last;
  572.       rtx funexp = gen_rtx (SYMBOL_REF, Pmode,
  573.                 unoptab->handlers[(int) mode].lib_call);
  574.  
  575.       /* Pass the address through a pseudoreg, if desired,
  576.      before the "beginning" of the library call (for deletion).  */
  577. #ifndef NO_FUNCTION_CSE
  578.       if (! flag_no_function_cse)
  579.     funexp = copy_to_mode_reg (Pmode, funexp);
  580. #endif
  581.  
  582.       insn_before = get_last_insn ();
  583.  
  584.       /* Cannot pass FUNEXP since  emit_library_call insists
  585.      on getting a SYMBOL_REF.  But cse will make this SYMBOL_REF
  586.      be replaced with the copy we made just above.  */
  587.       /* Pass 1 for NO_QUEUE so we don't lose any increments
  588.      if the libcall is cse'd or moved.  */
  589.       emit_library_call (gen_rtx (SYMBOL_REF, Pmode,
  590.                   unoptab->handlers[(int) mode].lib_call),
  591.              1, mode, 1, op0, mode);
  592.       target = hard_libcall_value (mode);
  593.       temp = copy_to_reg (target);
  594.       insn_last = get_last_insn ();
  595.       REG_NOTES (insn_last)
  596.     = gen_rtx (EXPR_LIST, REG_EQUAL,
  597.            gen_rtx (unoptab->code, mode, op0),
  598.            gen_rtx (INSN_LIST, REG_RETVAL,
  599.                 NEXT_INSN (insn_before),
  600.                 REG_NOTES (insn_last)));
  601.       REG_NOTES (NEXT_INSN (insn_before))
  602.     = gen_rtx (INSN_LIST, REG_LIBCALL, insn_last,
  603.            REG_NOTES (NEXT_INSN (insn_before)));
  604.       return temp;
  605.     }
  606.  
  607.   /* It can't be done in this mode.  Can we do it in a wider mode?  */
  608.  
  609.   if (class == MODE_INT || class == MODE_FLOAT)
  610.     {
  611.       for (wider_mode = INC_MODE (mode);
  612.        ((int) wider_mode < (int) MAX_MACHINE_MODE
  613.         && GET_MODE_CLASS (wider_mode) == class);
  614.        wider_mode = INC_MODE (wider_mode))
  615.     {
  616.       if ((unoptab->handlers[(int) wider_mode].insn_code
  617.            != CODE_FOR_nothing)
  618.           || unoptab->handlers[(int) wider_mode].lib_call)
  619.         {
  620.           if (GET_MODE (op0) != VOIDmode)
  621.         {
  622.           temp = gen_reg_rtx (wider_mode);
  623.           convert_move (temp, op0, unsignedp);
  624.           op0 = temp;
  625.         }
  626.           
  627.           target = expand_unop (wider_mode, unoptab, op0, 0, unsignedp);
  628.           if (class == MODE_FLOAT)
  629.         {
  630.           if (target == 0)
  631.             target = gen_reg_rtx (mode);
  632.           convert_move (target, temp, 0);
  633.           return target;
  634.         }
  635.           else
  636.         return gen_lowpart (mode, target);
  637.         }
  638.     }
  639.     }
  640.  
  641.   return 0;
  642. }
  643.  
  644. /* Generate an instruction whose insn-code is INSN_CODE,
  645.    with two operands: an output TARGET and an input OP0.
  646.    TARGET *must* be nonzero, and the output is always stored there.
  647.    CODE is an rtx code such that (CODE OP0) is an rtx that describes
  648.    the value that is stored into TARGET.  */
  649.  
  650. void
  651. emit_unop_insn (icode, target, op0, code)
  652.      int icode;
  653.      rtx target;
  654.      rtx op0;
  655.      enum rtx_code code;
  656. {
  657.   register rtx temp;
  658.   enum machine_mode mode0 = insn_operand_mode[icode][1];
  659.   rtx insn;
  660.   rtx prev_insn;
  661.  
  662.   temp = target = protect_from_queue (target, 1);
  663.  
  664.   op0 = protect_from_queue (op0, 0);
  665.  
  666.   if (flag_force_mem)
  667.     op0 = force_not_mem (op0);
  668.  
  669.   /* Now, if insn requires register operands, put operands into regs.  */
  670.  
  671.   if (! (*insn_operand_predicate[icode][1]) (op0, mode0))
  672.     op0 = force_reg (mode0, op0);
  673.  
  674.   if (! (*insn_operand_predicate[icode][0]) (temp, GET_MODE (temp))
  675.       || (flag_force_mem && GET_CODE (temp) == MEM))
  676.     temp = gen_reg_rtx (GET_MODE (temp));
  677.  
  678.   prev_insn = get_last_insn ();
  679.   insn = emit_insn (GEN_FCN (icode) (temp, op0));
  680.  
  681.   /* If we just made a multi-insn sequence,
  682.      record in the last insn an equivalent expression for its value
  683.      and a pointer to the first insn.  This makes cse possible.  */
  684.   if (code != UNKNOWN && PREV_INSN (insn) != prev_insn)
  685.     REG_NOTES (insn)
  686.       = gen_rtx (EXPR_LIST, REG_EQUAL,
  687.          gen_rtx (code, GET_MODE (temp), op0),
  688.          REG_NOTES (insn));
  689.   
  690.   if (temp != target)
  691.     emit_move_insn (target, temp);
  692. }
  693.  
  694. /* Generate code to store zero in X.  */
  695.  
  696. void
  697. emit_clr_insn (x)
  698.      rtx x;
  699. {
  700.   emit_move_insn (x, const0_rtx);
  701. }
  702.  
  703. /* Generate code to store 1 in X
  704.    assuming it contains zero beforehand.  */
  705.  
  706. void
  707. emit_0_to_1_insn (x)
  708.      rtx x;
  709. {
  710.   emit_move_insn (x, const1_rtx);
  711. }
  712.  
  713. /* Generate code to compare X with Y
  714.    so that the condition codes are set.
  715.  
  716.    UNSIGNEDP nonzero says that X and Y are unsigned;
  717.    this matters if they need to be widened.
  718.  
  719.    If they have mode BLKmode, then SIZE specifies the size of both X and Y,
  720.    and ALIGN specifies the known shared alignment of X and Y.  */
  721.  
  722. void
  723. emit_cmp_insn (x, y, size, unsignedp, align)
  724.      rtx x, y;
  725.      rtx size;
  726.      int unsignedp;
  727.      int align;
  728. {
  729.   enum machine_mode mode = GET_MODE (x);
  730.   enum mode_class class;
  731.   enum machine_mode wider_mode;
  732.  
  733.   if (mode == VOIDmode) mode = GET_MODE (y);
  734.   /* They could both be VOIDmode if both args are immediate constants,
  735.      but we should fold that at an earlier stage.
  736.      With no special code here, this will call abort,
  737.      reminding the programmer to implement such folding.  */
  738.  
  739.   class = GET_MODE_CLASS (mode);
  740.  
  741.   if (mode != BLKmode && flag_force_mem)
  742.     {
  743.       x = force_not_mem (x);
  744.       y = force_not_mem (y);
  745.     }
  746.  
  747.   /* Handle all BLKmode compares.  */
  748.  
  749.   if (mode == BLKmode)
  750.     {
  751.       emit_queue ();
  752.       x = protect_from_queue (x, 0);
  753.       y = protect_from_queue (y, 0);
  754.  
  755.       if (size == 0)
  756.     abort ();
  757. #ifdef HAVE_cmpstrqi
  758.       if (HAVE_cmpstrqi
  759.       && GET_CODE (size) == CONST_INT
  760.       && INTVAL (size) < (1 << GET_MODE_BITSIZE (QImode)))
  761.     emit_insn (gen_cmpstrqi (x, y, size,
  762.                  gen_rtx (CONST_INT, VOIDmode, align)));
  763.       else
  764. #endif
  765. #ifdef HAVE_cmpstrhi
  766.       if (HAVE_cmpstrhi
  767.       && GET_CODE (size) == CONST_INT
  768.       && INTVAL (size) < (1 << GET_MODE_BITSIZE (HImode)))
  769.     emit_insn (gen_cmpstrhi (x, y, size,
  770.                  gen_rtx (CONST_INT, VOIDmode, align)));
  771.       else
  772. #endif
  773. #ifdef HAVE_cmpstrsi
  774.       if (HAVE_cmpstrsi)
  775.     emit_insn (gen_cmpstrsi (x, y, convert_to_mode (SImode, size, 1),
  776.                  gen_rtx (CONST_INT, VOIDmode, align)));
  777.       else
  778. #endif
  779.     {
  780. #ifdef TARGET_MEM_FUNCTIONS
  781.       emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "memcmp"), 0, 
  782.                  SImode, 3,
  783.                  XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
  784.                  size, Pmode);
  785. #else
  786.       emit_library_call (gen_rtx (SYMBOL_REF, Pmode, "bcmp"), 0,
  787.                  SImode, 3,
  788.                  XEXP (x, 0), Pmode, XEXP (y, 0), Pmode,
  789.                  size, Pmode);
  790. #endif
  791.       emit_cmp_insn (hard_libcall_value (SImode), const0_rtx, 0, 0, 0);
  792.     }
  793.       return;
  794.     }
  795.  
  796.   /* Handle some compares against zero.  */
  797.  
  798.   if (y == CONST0_RTX (mode)
  799.       && tst_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  800.     {
  801.       int icode = (int) tst_optab->handlers[(int) mode].insn_code;
  802.  
  803.       emit_queue ();
  804.       x = protect_from_queue (x, 0);
  805.       y = protect_from_queue (y, 0);
  806.  
  807.       /* Now, if insn requires register operands, put operands into regs.  */
  808.       if (! (*insn_operand_predicate[icode][0])
  809.       (x, insn_operand_mode[icode][0]))
  810.     x = force_reg (insn_operand_mode[icode][0], x);
  811.  
  812.       emit_insn (GEN_FCN (icode) (x));
  813.       return;
  814.     }
  815.  
  816.   /* Handle compares for which there is a directly suitable insn.  */
  817.  
  818.   if (cmp_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
  819.     {
  820.       int icode = (int) cmp_optab->handlers[(int) mode].insn_code;
  821.  
  822.       emit_queue ();
  823.       x = protect_from_queue (x, 0);
  824.       y = protect_from_queue (y, 0);
  825.  
  826.       /* Now, if insn requires register operands, put operands into regs.  */
  827.       if (! (*insn_operand_predicate[icode][0])
  828.       (x, insn_operand_mode[icode][0]))
  829.     x = force_reg (insn_operand_mode[icode][0], x);
  830.  
  831.       if (! (*insn_operand_predicate[icode][1])
  832.       (y, insn_operand_mode[icode][1]))
  833.     y = force_reg (insn_operand_mode[icode][1], y);
  834.  
  835.       emit_insn (GEN_FCN (icode) (x, y));
  836.       return;
  837.     }
  838.  
  839.   /* Try widening if we can find a direct insn that way.  */
  840.  
  841.   if (class == MODE_INT || class == MODE_FLOAT)
  842.     {
  843.       for (wider_mode = INC_MODE (mode);
  844.        ((int) wider_mode < (int) MAX_MACHINE_MODE
  845.         && GET_MODE_CLASS (wider_mode) == class);
  846.        wider_mode = INC_MODE (wider_mode))
  847.     {
  848.       if (cmp_optab->handlers[(int) wider_mode].insn_code
  849.           != CODE_FOR_nothing)
  850.         {
  851.           x = convert_to_mode (wider_mode, x, unsignedp);
  852.           y = convert_to_mode (wider_mode, y, unsignedp);
  853.           emit_cmp_insn (x, y, 0, unsignedp, align);
  854.           return;
  855.         }
  856.     }
  857.     }
  858.  
  859.   /* Handle a lib call just for the mode we are using.  */
  860.  
  861.   if (cmp_optab->handlers[(int) mode].lib_call)
  862.     {
  863.       char *string = cmp_optab->handlers[(int) mode].lib_call;
  864.       /* If we want unsigned, and this mode has a distinct unsigned
  865.      comparison routine, use that.  */
  866.       if (unsignedp && ucmp_optab->handlers[(int) mode].lib_call)
  867.     string = ucmp_optab->handlers[(int) mode].lib_call;
  868.  
  869.       emit_library_call (gen_rtx (SYMBOL_REF, Pmode, string), 0,
  870.              SImode, 2, x, mode, y, mode);
  871.  
  872.       /* Integer comparison returns a result that must be compared against 1,
  873.      so that even if we do an unsigned compare afterward,
  874.      there is still a value that can represent the result "less than".  */
  875.       if (GET_MODE_CLASS (mode) == MODE_INT)
  876.     emit_cmp_insn (hard_libcall_value (SImode), const1_rtx, 0, unsignedp, 0);
  877.       else
  878.     emit_cmp_insn (hard_libcall_value (SImode), const0_rtx, 0, 0, 0);
  879.       return;
  880.     }
  881.  
  882.   /* Try widening and then using a libcall.  */
  883.  
  884.   if (class == MODE_FLOAT)
  885.     {
  886.       for (wider_mode = INC_MODE (mode);
  887.        ((int) wider_mode < (int) MAX_MACHINE_MODE
  888.         && GET_MODE_CLASS (wider_mode) == class);
  889.        wider_mode = INC_MODE (wider_mode))
  890.     {
  891.       if ((cmp_optab->handlers[(int) wider_mode].insn_code
  892.            != CODE_FOR_nothing)
  893.           || (cmp_optab->handlers[(int) wider_mode].lib_call != 0))
  894.         {
  895.           x = convert_to_mode (wider_mode, x, unsignedp);
  896.           y = convert_to_mode (wider_mode, y, unsignedp);
  897.           emit_cmp_insn (x, y, 0, unsignedp, align);
  898.         }
  899.     }
  900.       return;
  901.     }
  902.  
  903.   abort ();
  904. }
  905.  
  906. /* These three functions generate an insn body and return it
  907.    rather than emitting the insn.
  908.  
  909.    They do not protect from queued increments,
  910.    because they may be used 1) in protect_from_queue itself
  911.    and 2) in other passes where there is no queue.  */
  912.  
  913. /* Generate and return an insn body to add Y to X.  */
  914.  
  915. rtx
  916. gen_add2_insn (x, y)
  917.      rtx x, y;
  918. {
  919.   return (GEN_FCN (add_optab->handlers[(int) GET_MODE (x)].insn_code)
  920.       (x, x, y));
  921. }
  922.  
  923. int
  924. have_add2_insn (mode)
  925.      enum machine_mode mode;
  926. {
  927.   return add_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing;
  928. }
  929.  
  930. /* Generate and return an insn body to subtract Y from X.  */
  931.  
  932. rtx
  933. gen_sub2_insn (x, y)
  934.      rtx x, y;
  935. {
  936.   return (GEN_FCN (sub_optab->handlers[(int) GET_MODE (x)].insn_code)
  937.       (x, x, y));
  938. }
  939.  
  940. int
  941. have_sub2_insn (mode)
  942.      enum machine_mode mode;
  943. {
  944.   return add_optab->handlers[(int) mode].insn_code != CODE_FOR_nothing;
  945. }
  946.  
  947. /* Generate the body of an instruction to copy Y into X.  */
  948.  
  949. rtx
  950. gen_move_insn (x, y)
  951.      rtx x, y;
  952. {
  953.   register enum machine_mode mode = GET_MODE (x);
  954.   if (mode == VOIDmode)
  955.     mode = GET_MODE (y);
  956.   return (GEN_FCN (mov_optab->handlers[(int) mode].insn_code) (x, y));
  957. }
  958.  
  959. #if 0
  960. /* Tables of patterns for extending one integer mode to another.  */
  961. enum insn_code zero_extend_optab[MAX_MACHINE_MODE][MAX_MACHINE_MODE];
  962. enum insn_code sign_extend_optab[MAX_MACHINE_MODE][MAX_MACHINE_MODE];
  963.  
  964. /* Generate the body of an insn to extend Y (with mode MFROM)
  965.    into X (with mode MTO).  Do zero-extension if UNSIGNEDP is nonzero.  */
  966.  
  967. rtx
  968. gen_extend_insn (x, y, mto, mfrom, unsignedp)
  969.      rtx x, y;
  970.      enum machine_mode mto, mfrom;
  971.      int unsignedp;
  972. {
  973.   return (GEN_FCN ((unsignedp ? zero_extend_optab : sign_extend_optab)
  974.            [(int)mto][(int)mfrom])
  975.       (x, y));
  976. }
  977.  
  978. static void
  979. init_extends ()
  980. {
  981.   bzero (sign_extend_optab, sizeof sign_extend_optab);
  982.   bzero (zero_extend_optab, sizeof zero_extend_optab);
  983.   sign_extend_optab[(int) SImode][(int) HImode] = CODE_FOR_extendhisi2;
  984.   sign_extend_optab[(int) SImode][(int) QImode] = CODE_FOR_extendqisi2;
  985.   sign_extend_optab[(int) HImode][(int) QImode] = CODE_FOR_extendqihi2;
  986.   zero_extend_optab[(int) SImode][(int) HImode] = CODE_FOR_zero_extendhisi2;
  987.   zero_extend_optab[(int) SImode][(int) QImode] = CODE_FOR_zero_extendqisi2;
  988.   zero_extend_optab[(int) HImode][(int) QImode] = CODE_FOR_zero_extendqihi2;
  989. }
  990. #endif
  991.  
  992. /* can_fix_p and can_float_p say whether the target machine
  993.    can directly convert a given fixed point type to
  994.    a given floating point type, or vice versa.
  995.    The returned value is the CODE_FOR_... value to use,
  996.    or CODE_FOR_nothing if these modes cannot be directly converted.  */
  997.  
  998. static enum insn_code fixtab[2][2][2];
  999. static enum insn_code fixtrunctab[2][2][2];
  1000. static enum insn_code floattab[2][2];
  1001.  
  1002. /* *TRUNCP_PTR is set to 1 if it is necessary to output
  1003.    an explicit FTRUNC insn before the fix insn; otherwise 0.  */
  1004.  
  1005. static enum insn_code
  1006. can_fix_p (fixmode, fltmode, unsignedp, truncp_ptr)
  1007.      enum machine_mode fltmode, fixmode;
  1008.      int unsignedp;
  1009.      int *truncp_ptr;
  1010. {
  1011.   *truncp_ptr = 0;
  1012.   if (fixtrunctab[fltmode != SFmode][fixmode == DImode][unsignedp]
  1013.       != CODE_FOR_nothing)
  1014.     return fixtrunctab[fltmode != SFmode][fixmode == DImode][unsignedp];
  1015.   if (ftrunc_optab->handlers[(int) fltmode].insn_code != CODE_FOR_nothing)
  1016.     {
  1017.       *truncp_ptr = 1;
  1018.       return fixtab[fltmode != SFmode][fixmode == DImode][unsignedp];
  1019.     }
  1020.   return CODE_FOR_nothing;
  1021. }
  1022.  
  1023. static enum insn_code
  1024. can_float_p (fltmode, fixmode)
  1025.      enum machine_mode fixmode, fltmode;
  1026. {
  1027.   return floattab[fltmode != SFmode][fixmode == DImode];
  1028. }
  1029.  
  1030. void
  1031. init_fixtab ()
  1032. {
  1033.   enum insn_code *p;
  1034.   for (p = fixtab[0][0];
  1035.        p < fixtab[0][0] + sizeof fixtab / sizeof (fixtab[0][0][0]); 
  1036.        p++)
  1037.     *p = CODE_FOR_nothing;
  1038.   for (p = fixtrunctab[0][0];
  1039.        p < fixtrunctab[0][0] + sizeof fixtrunctab / sizeof (fixtrunctab[0][0][0]); 
  1040.        p++)
  1041.     *p = CODE_FOR_nothing;
  1042.  
  1043. #ifdef HAVE_fixsfsi2
  1044.   if (HAVE_fixsfsi2)
  1045.     fixtab[0][0][0] = CODE_FOR_fixsfsi2;
  1046. #endif
  1047. #ifdef HAVE_fixsfdi2
  1048.   if (HAVE_fixsfdi2)
  1049.     fixtab[0][1][0] = CODE_FOR_fixsfdi2;
  1050. #endif
  1051. #ifdef HAVE_fixdfsi2
  1052.   if (HAVE_fixdfsi2)
  1053.     fixtab[1][0][0] = CODE_FOR_fixdfsi2;
  1054. #endif
  1055. #ifdef HAVE_fixdfdi2
  1056.   if (HAVE_fixdfdi2)
  1057.     fixtab[1][1][0] = CODE_FOR_fixdfdi2;
  1058. #endif
  1059.  
  1060. #ifdef HAVE_fixunssfsi2
  1061.   if (HAVE_fixunssfsi2)
  1062.     fixtab[0][0][1] = CODE_FOR_fixunssfsi2;
  1063. #endif
  1064. #ifdef HAVE_fixunssfdi2
  1065.   if (HAVE_fixunssfdi2)
  1066.     fixtab[0][1][1] = CODE_FOR_fixunssfdi2;
  1067. #endif
  1068. #ifdef HAVE_fixunsdfsi2
  1069.   if (HAVE_fixunsdfsi2)
  1070.     fixtab[1][0][1] = CODE_FOR_fixunsdfsi2;
  1071. #endif
  1072. #ifdef HAVE_fixunsdfdi2
  1073.   if (HAVE_fixunsdfdi2)
  1074.     fixtab[1][1][1] = CODE_FOR_fixunsdfdi2;
  1075. #endif
  1076.  
  1077. #ifdef HAVE_fix_truncsfsi2
  1078.   if (HAVE_fix_truncsfsi2)
  1079.     fixtrunctab[0][0][0] = CODE_FOR_fix_truncsfsi2;
  1080. #endif
  1081. #ifdef HAVE_fix_truncsfdi2
  1082.   if (HAVE_fix_truncsfdi2)
  1083.     fixtrunctab[0][1][0] = CODE_FOR_fix_truncsfdi2;
  1084. #endif
  1085. #ifdef HAVE_fix_truncdfsi2
  1086.   if (HAVE_fix_truncdfsi2)
  1087.     fixtrunctab[1][0][0] = CODE_FOR_fix_truncdfsi2;
  1088. #endif
  1089. #ifdef HAVE_fix_truncdfdi2
  1090.   if (HAVE_fix_truncdfdi2)
  1091.     fixtrunctab[1][1][0] = CODE_FOR_fix_truncdfdi2;
  1092. #endif
  1093.  
  1094. #ifdef HAVE_fixuns_truncsfsi2
  1095.   if (HAVE_fixuns_truncsfsi2)
  1096.     fixtrunctab[0][0][1] = CODE_FOR_fixuns_truncsfsi2;
  1097. #endif
  1098. #ifdef HAVE_fixuns_truncsfdi2
  1099.   if (HAVE_fixuns_truncsfdi2)
  1100.     fixtrunctab[0][1][1] = CODE_FOR_fixuns_truncsfdi2;
  1101. #endif
  1102. #ifdef HAVE_fixuns_truncdfsi2
  1103.   if (HAVE_fixuns_truncdfsi2)
  1104.     fixtrunctab[1][0][1] = CODE_FOR_fixuns_truncdfsi2;
  1105. #endif
  1106. #ifdef HAVE_fixuns_truncdfdi2
  1107.   if (HAVE_fixuns_truncdfdi2)
  1108.     fixtrunctab[1][1][1] = CODE_FOR_fixuns_truncdfdi2;
  1109. #endif
  1110.  
  1111. #ifdef FIXUNS_TRUNC_LIKE_FIX_TRUNC
  1112.   /* This flag says the same insns that convert to a signed fixnum
  1113.      also convert validly to an unsigned one.  */
  1114.   {
  1115.     int i;
  1116.     int j;
  1117.     for (i = 0; i < 2; i++)
  1118.       for (j = 0; j < 2; j++)
  1119.     fixtrunctab[i][j][1] = fixtrunctab[i][j][0];
  1120.   }
  1121. #endif
  1122. }
  1123.  
  1124. void
  1125. init_floattab ()
  1126. {
  1127.   enum insn_code *p;
  1128.   for (p = floattab[0];
  1129.        p < floattab[0] + sizeof floattab / sizeof (floattab[0][0]); 
  1130.        p++)
  1131.     *p = CODE_FOR_nothing;
  1132.  
  1133. #ifdef HAVE_floatsisf2
  1134.   if (HAVE_floatsisf2)
  1135.     floattab[0][0] = CODE_FOR_floatsisf2;
  1136. #endif
  1137. #ifdef HAVE_floatdisf2
  1138.   if (HAVE_floatdisf2)
  1139.     floattab[0][1] = CODE_FOR_floatdisf2;
  1140. #endif
  1141. #ifdef HAVE_floatsidf2
  1142.   if (HAVE_floatsidf2)
  1143.     floattab[1][0] = CODE_FOR_floatsidf2;
  1144. #endif
  1145. #ifdef HAVE_floatdidf2
  1146.   if (HAVE_floatdidf2)
  1147.     floattab[1][1] = CODE_FOR_floatdidf2;
  1148. #endif
  1149. }
  1150.  
  1151. /* Generate code to convert FROM to floating point
  1152.    and store in TO.  FROM must be fixed point.
  1153.    UNSIGNEDP nonzero means regard FROM as unsigned.
  1154.    Normally this is done by correcting the final value
  1155.    if it is negative.  */
  1156.  
  1157. void
  1158. expand_float (real_to, from, unsignedp)
  1159.      rtx real_to, from;
  1160.      int unsignedp;
  1161. {
  1162.   enum insn_code icode;
  1163.   register rtx to;
  1164.  
  1165.   /* Constants should get converted in `fold'.
  1166.      We lose here since we don't know the mode.  */
  1167.   if (GET_MODE (from) == VOIDmode)
  1168.     abort ();
  1169.  
  1170.   to = real_to = protect_from_queue (real_to, 1);
  1171.   from = protect_from_queue (from, 0);
  1172.  
  1173.   if (flag_force_mem)
  1174.     {
  1175.       from = force_not_mem (from);
  1176.     }
  1177.  
  1178.   /* If we are about to do some arithmetic to correct for an
  1179.      unsigned operand, do it in a register.  */
  1180.  
  1181.   if (unsignedp && GET_CODE (to) != REG)
  1182.     to = gen_reg_rtx (GET_MODE (to));
  1183.  
  1184.   /* Now do the basic conversion.  Do it in the specified modes if possible;
  1185.      otherwise convert either input, output or both with wider mode;
  1186.      otherwise use a library call.  */
  1187.  
  1188.   if ((icode = can_float_p (GET_MODE (to), GET_MODE (from)))
  1189.       != CODE_FOR_nothing)
  1190.     {
  1191.       emit_unop_insn (icode, to, from, FLOAT);
  1192.     }
  1193.   else if (GET_MODE (to) == SFmode
  1194.        && ((icode = can_float_p (DFmode, GET_MODE (from)))
  1195.            != CODE_FOR_nothing))
  1196.     {
  1197.       to = gen_reg_rtx (DFmode);
  1198.       emit_unop_insn (icode, to, from, FLOAT);
  1199.     }
  1200.   /* If we can't float a SI, maybe we can float a DI.
  1201.      If so, convert to DI and then float.  */
  1202.   else if (GET_MODE (from) != DImode
  1203.        && (can_float_p (GET_MODE (to), DImode) != CODE_FOR_nothing
  1204.            || can_float_p (DFmode, DImode) != CODE_FOR_nothing))
  1205.     {
  1206.       register rtx tem = gen_reg_rtx (DImode);
  1207.       convert_move (tem, from, unsignedp);
  1208.       from = tem;
  1209.       /* If we extend FROM then we don't need to correct
  1210.      the final value for unsignedness.  */
  1211.       unsignedp = 0;
  1212.  
  1213.       if ((icode = can_float_p (GET_MODE (to), GET_MODE (from)))
  1214.       != CODE_FOR_nothing)
  1215.     {
  1216.       emit_unop_insn (icode, to, from, FLOAT);
  1217.     }
  1218.       else if ((icode = can_float_p (DFmode, DImode))
  1219.             != CODE_FOR_nothing)
  1220.     {
  1221.       to = gen_reg_rtx (DFmode);
  1222.       emit_unop_insn (icode, to, from, FLOAT);
  1223.     }
  1224.     }
  1225.   /* No hardware instruction available; call a library
  1226.      to convert from SImode or DImode into DFmode.  */
  1227.   else
  1228.     {
  1229.       if (GET_MODE_SIZE (GET_MODE (from)) < GET_MODE_SIZE (SImode))
  1230.     {
  1231.       from = convert_to_mode (SImode, from, unsignedp);
  1232.       unsignedp = 0;
  1233.     }
  1234.       emit_library_call (gen_rtx (SYMBOL_REF, Pmode,
  1235.                   (GET_MODE (from) == SImode ? "__floatsidf"
  1236.                    : "__floatdidf")),
  1237.              0, DFmode, 1, from, GET_MODE (from));
  1238.       to = copy_to_reg (hard_libcall_value (DFmode));
  1239.     }
  1240.  
  1241.   /* If FROM was unsigned but we treated it as signed,
  1242.      then in the case where it is negative (and therefore TO is negative),
  1243.      correct its value by 2**bitwidth.  */
  1244.  
  1245.   if (unsignedp)
  1246.     {
  1247.       rtx label = gen_label_rtx ();
  1248.       rtx temp;
  1249.       REAL_VALUE_TYPE offset;
  1250.  
  1251.       do_pending_stack_adjust ();
  1252.       emit_cmp_insn (to, GET_MODE (to) == DFmode ? dconst0_rtx : fconst0_rtx,
  1253.              0, 0, 0);
  1254.       emit_jump_insn (gen_bge (label));
  1255.       offset = REAL_VALUE_LDEXP (1.0, GET_MODE_BITSIZE (GET_MODE (from)));
  1256.       temp = expand_binop (GET_MODE (to), add_optab, to,
  1257.                immed_real_const_1 (offset, GET_MODE (to)),
  1258.                to, 0, OPTAB_LIB_WIDEN);
  1259.       if (temp != to)
  1260.     emit_move_insn (to, temp);
  1261.       do_pending_stack_adjust ();
  1262.       emit_label (label);
  1263.     }
  1264.  
  1265.   /* Copy result to requested destination
  1266.      if we have been computing in a temp location.  */
  1267.  
  1268.   if (to != real_to)
  1269.     {
  1270.       if (GET_MODE (real_to) == GET_MODE (to))
  1271.     emit_move_insn (real_to, to);
  1272.       else
  1273.     convert_move (real_to, to, 0);
  1274.     }
  1275. }
  1276.  
  1277. /* expand_fix: generate code to convert FROM to fixed point
  1278.    and store in TO.  FROM must be floating point.  */
  1279.  
  1280. static rtx
  1281. ftruncify (x)
  1282.      rtx x;
  1283. {
  1284.   rtx temp = gen_reg_rtx (GET_MODE (x));
  1285.   return expand_unop (GET_MODE (x), ftrunc_optab, x, temp, 0);
  1286. }
  1287.  
  1288. void
  1289. expand_fix (to, from, unsignedp)
  1290.      register rtx to, from;
  1291.      int unsignedp;
  1292. {
  1293.   enum insn_code icode;
  1294.   register rtx target;
  1295.   int must_trunc = 0;
  1296.  
  1297.   while (1)
  1298.     {
  1299.       icode = can_fix_p (GET_MODE (to), GET_MODE (from), unsignedp, &must_trunc);
  1300.       if (icode != CODE_FOR_nothing)
  1301.     {
  1302.       if (must_trunc)
  1303.         from = ftruncify (from);
  1304.  
  1305.       emit_unop_insn (icode, to, from, FIX);
  1306.       return;
  1307.     }
  1308.  
  1309. #if 0  /* Turned off.  It fails because the positive numbers
  1310.       that become temporarily negative are rounded up instead of down.  */
  1311.  
  1312.       /* If no insns for unsigned conversion,
  1313.      we can go via a signed number.
  1314.      But make sure we won't overflow in the compiler.  */
  1315.       if (unsignedp && GET_MODE_BITSIZE (GET_MODE (to)) <= HOST_BITS_PER_INT
  1316.       /* Make sure we won't lose significant bits doing this.  */
  1317.       && GET_MODE_BITSIZE (GET_MODE (from)) > GET_MODE_BITSIZE (GET_MODE (to)))
  1318.     {
  1319.       icode = can_fix_p (GET_MODE (to), GET_MODE (from),
  1320.                  0, &must_trunc);
  1321.  
  1322.       if (icode != CODE_FOR_nothing)
  1323.         {
  1324.           REAL_VALUE_TYPE offset;
  1325.           rtx temp, temp1;
  1326.           int bitsize = GET_MODE_BITSIZE (GET_MODE (to));
  1327.  
  1328.           if (must_trunc)
  1329.         from = ftruncify (from);
  1330.  
  1331.           /* Subtract 2**(N-1), convert to signed number,
  1332.          then add 2**(N-1).  */
  1333.           offset = REAL_VALUE_LDEXP (1.0, bitsize - 1);
  1334.           temp = expand_binop (GET_MODE (from), sub_optab, from,
  1335.                    immed_real_const_1 (offset, GET_MODE (from)),
  1336.                    0, 0, OPTAB_LIB_WIDEN);
  1337.  
  1338.           temp1 = gen_reg_rtx (GET_MODE (to));
  1339.           emit_unop_insn (icode, temp1, temp, FIX);
  1340.           temp = expand_binop (GET_MODE (to), add_optab, temp1,
  1341.                    gen_rtx (CONST_INT, VOIDmode,
  1342.                         1 << (bitsize - 1)),
  1343.                    to, 1, OPTAB_LIB_WIDEN);
  1344.           if (temp != to)
  1345.         emit_move_insn (to, temp);
  1346.           return;
  1347.         }
  1348.     }
  1349. #endif
  1350.       icode = can_fix_p (DImode, GET_MODE (from), unsignedp, &must_trunc);
  1351.  
  1352.       if (GET_MODE (to) != DImode && icode != CODE_FOR_nothing)
  1353.     {
  1354.       register rtx temp = gen_reg_rtx (DImode);
  1355.  
  1356.       if (must_trunc)
  1357.         from = ftruncify (from);
  1358.       emit_unop_insn (icode, temp, from, FIX);
  1359.       convert_move (to, temp, unsignedp);
  1360.       return;
  1361.     }
  1362.  
  1363.       /* If FROM is not DFmode, convert to DFmode and try again from there.  */
  1364.       if (GET_MODE (from) == DFmode)
  1365.     break;
  1366.  
  1367.       from = convert_to_mode (DFmode, from, 0);
  1368.     }
  1369.  
  1370.   /* We can't do it with an insn, so use a library call.
  1371.      The mode of FROM is known to be DFmode.  */
  1372.  
  1373.   to = protect_from_queue (to, 1);
  1374.   from = protect_from_queue (from, 0);
  1375.  
  1376.   if (flag_force_mem)
  1377.     from = force_not_mem (from);
  1378.  
  1379.   if (GET_MODE (to) != DImode)
  1380.     {
  1381.       emit_library_call (gen_rtx (SYMBOL_REF, Pmode,
  1382.                   unsignedp ? "__fixunsdfsi"
  1383.                   : "__fixdfsi"),
  1384.              0, SImode, 1, from, DFmode);
  1385.       target = hard_libcall_value (SImode);
  1386.     }
  1387.   else
  1388.     {
  1389.       emit_library_call (gen_rtx (SYMBOL_REF, Pmode,
  1390.                   unsignedp ? "__fixunsdfdi"
  1391.                   : "__fixdfdi"),
  1392.              0, DImode, 1, from, DFmode);
  1393.       target = hard_libcall_value (DImode);
  1394.     }
  1395.  
  1396.   if (GET_MODE (to) == GET_MODE (target))
  1397.     emit_move_insn (to, target);
  1398.   else
  1399.     convert_move (to, target, 0);
  1400. }
  1401.  
  1402. static optab
  1403. init_optab (code)
  1404.      enum rtx_code code;
  1405. {
  1406.   int i;
  1407.   optab op = (optab) malloc (sizeof (struct optab));
  1408.   op->code = code;
  1409.   for (i = 0; i < NUM_MACHINE_MODES; i++)
  1410.     {
  1411.       op->handlers[i].insn_code = CODE_FOR_nothing;
  1412.       op->handlers[i].lib_call = 0;
  1413.     }
  1414.   return op;
  1415. }
  1416.  
  1417. /* Call this once to initialize the contents of the optabs
  1418.    appropriately for the current target machine.  */
  1419.  
  1420. void
  1421. init_optabs ()
  1422. {
  1423.   init_fixtab ();
  1424.   init_floattab ();
  1425.   init_comparisons ();
  1426. /*  init_extends (); */
  1427.  
  1428.   add_optab = init_optab (PLUS);
  1429.   sub_optab = init_optab (MINUS);
  1430.   smul_optab = init_optab (MULT);
  1431.   umul_optab = init_optab (UMULT);
  1432.   smul_widen_optab = init_optab (MULT);
  1433.   umul_widen_optab = init_optab (UMULT);
  1434.   sdiv_optab = init_optab (DIV);
  1435.   sdivmod_optab = init_optab (UNKNOWN);
  1436.   udiv_optab = init_optab (UDIV);
  1437.   udivmod_optab = init_optab (UNKNOWN);
  1438.   smod_optab = init_optab (MOD);
  1439.   umod_optab = init_optab (UMOD);
  1440.   flodiv_optab = init_optab (DIV);
  1441.   ftrunc_optab = init_optab (UNKNOWN);
  1442.   and_optab = init_optab (AND);
  1443.   andcb_optab = init_optab (UNKNOWN);
  1444.   ior_optab = init_optab (IOR);
  1445.   xor_optab = init_optab (XOR);
  1446.   ashl_optab = init_optab (ASHIFT);
  1447.   ashr_optab = init_optab (ASHIFTRT);
  1448.   lshl_optab = init_optab (LSHIFT);
  1449.   lshr_optab = init_optab (LSHIFTRT);
  1450.   rotl_optab = init_optab (ROTATE);
  1451.   rotr_optab = init_optab (ROTATERT);
  1452.   mov_optab = init_optab (UNKNOWN);
  1453.   movstrict_optab = init_optab (UNKNOWN);
  1454.   cmp_optab = init_optab (UNKNOWN);
  1455.   ucmp_optab = init_optab (UNKNOWN);
  1456.   tst_optab = init_optab (UNKNOWN);
  1457.   neg_optab = init_optab (NEG);
  1458.   abs_optab = init_optab (ABS);
  1459.   one_cmpl_optab = init_optab (NOT);
  1460.   ffs_optab = init_optab (FFS);
  1461.  
  1462. #ifdef HAVE_addqi3
  1463.   if (HAVE_addqi3)
  1464.     add_optab->handlers[(int) QImode].insn_code = CODE_FOR_addqi3;
  1465. #endif
  1466. #ifdef HAVE_addhi3
  1467.   if (HAVE_addhi3)
  1468.     add_optab->handlers[(int) HImode].insn_code = CODE_FOR_addhi3;
  1469. #endif
  1470. #ifdef HAVE_addsi3
  1471.   if (HAVE_addsi3)
  1472.     add_optab->handlers[(int) SImode].insn_code = CODE_FOR_addsi3;
  1473. #endif
  1474. #ifdef HAVE_adddi3
  1475.   if (HAVE_adddi3)
  1476.     add_optab->handlers[(int) DImode].insn_code = CODE_FOR_adddi3;
  1477. #endif
  1478. #ifdef HAVE_addsf3
  1479.   if (HAVE_addsf3)
  1480.     add_optab->handlers[(int) SFmode].insn_code = CODE_FOR_addsf3;
  1481. #endif
  1482. #ifdef HAVE_adddf3
  1483.   if (HAVE_adddf3)
  1484.     add_optab->handlers[(int) DFmode].insn_code = CODE_FOR_adddf3;
  1485. #endif
  1486.   add_optab->handlers[(int) DImode].lib_call = "__adddi3";
  1487.   add_optab->handlers[(int) SFmode].lib_call = "__addsf3";
  1488.   add_optab->handlers[(int) DFmode].lib_call = "__adddf3";
  1489.  
  1490. #ifdef HAVE_subqi3
  1491.   if (HAVE_subqi3)
  1492.     sub_optab->handlers[(int) QImode].insn_code = CODE_FOR_subqi3;
  1493. #endif
  1494. #ifdef HAVE_subhi3
  1495.   if (HAVE_subhi3)
  1496.     sub_optab->handlers[(int) HImode].insn_code = CODE_FOR_subhi3;
  1497. #endif
  1498. #ifdef HAVE_subsi3
  1499.   if (HAVE_subsi3)
  1500.     sub_optab->handlers[(int) SImode].insn_code = CODE_FOR_subsi3;
  1501. #endif
  1502. #ifdef HAVE_subdi3
  1503.   if (HAVE_subdi3)
  1504.     sub_optab->handlers[(int) DImode].insn_code = CODE_FOR_subdi3;
  1505. #endif
  1506. #ifdef HAVE_subsf3
  1507.   if (HAVE_subsf3)
  1508.     sub_optab->handlers[(int) SFmode].insn_code = CODE_FOR_subsf3;
  1509. #endif
  1510. #ifdef HAVE_subdf3
  1511.   if (HAVE_subdf3)
  1512.     sub_optab->handlers[(int) DFmode].insn_code = CODE_FOR_subdf3;
  1513. #endif
  1514.   sub_optab->handlers[(int) DImode].lib_call = "__subdi3";
  1515.   sub_optab->handlers[(int) SFmode].lib_call = "__subsf3";
  1516.   sub_optab->handlers[(int) DFmode].lib_call = "__subdf3";
  1517.  
  1518. #ifdef HAVE_mulqi3
  1519.   if (HAVE_mulqi3)
  1520.     smul_optab->handlers[(int) QImode].insn_code = CODE_FOR_mulqi3;
  1521. #endif
  1522. #ifdef HAVE_mulhi3
  1523.   if (HAVE_mulhi3)
  1524.     smul_optab->handlers[(int) HImode].insn_code = CODE_FOR_mulhi3;
  1525. #endif
  1526. #ifdef HAVE_mulsi3
  1527.   if (HAVE_mulsi3)
  1528.     smul_optab->handlers[(int) SImode].insn_code = CODE_FOR_mulsi3;
  1529. #endif
  1530. #ifdef HAVE_muldi3
  1531.   if (HAVE_muldi3)
  1532.     smul_optab->handlers[(int) DImode].insn_code = CODE_FOR_muldi3;
  1533. #endif
  1534. #ifdef HAVE_mulsf3
  1535.   if (HAVE_mulsf3)
  1536.     smul_optab->handlers[(int) SFmode].insn_code = CODE_FOR_mulsf3;
  1537. #endif
  1538. #ifdef HAVE_muldf3
  1539.   if (HAVE_muldf3)
  1540.     smul_optab->handlers[(int) DFmode].insn_code = CODE_FOR_muldf3;
  1541. #endif
  1542.  
  1543. #ifdef MULSI3_LIBCALL
  1544.   smul_optab->handlers[(int) SImode].lib_call = MULSI3_LIBCALL;
  1545. #else
  1546.   smul_optab->handlers[(int) SImode].lib_call = "__mulsi3";
  1547. #endif
  1548.   smul_optab->handlers[(int) DImode].lib_call = "__muldi3";
  1549.   smul_optab->handlers[(int) SFmode].lib_call = "__mulsf3";
  1550.   smul_optab->handlers[(int) DFmode].lib_call = "__muldf3";
  1551.  
  1552. #ifdef HAVE_mulqihi3
  1553.   if (HAVE_mulqihi3)
  1554.     smul_widen_optab->handlers[(int) HImode].insn_code = CODE_FOR_mulqihi3;
  1555. #endif
  1556. #ifdef HAVE_mulhisi3
  1557.   if (HAVE_mulhisi3)
  1558.     smul_widen_optab->handlers[(int) SImode].insn_code = CODE_FOR_mulhisi3;
  1559. #endif
  1560. #ifdef HAVE_mulsidi3
  1561.   if (HAVE_mulsidi3)
  1562.     smul_widen_optab->handlers[(int) DImode].insn_code = CODE_FOR_mulsidi3;
  1563. #endif
  1564.  
  1565. #ifdef HAVE_umulqi3
  1566.   if (HAVE_umulqi3)
  1567.     umul_optab->handlers[(int) QImode].insn_code = CODE_FOR_umulqi3;
  1568. #endif
  1569. #ifdef HAVE_umulhi3
  1570.   if (HAVE_umulhi3)
  1571.     umul_optab->handlers[(int) HImode].insn_code = CODE_FOR_umulhi3;
  1572. #endif
  1573. #ifdef HAVE_umulsi3
  1574.   if (HAVE_umulsi3)
  1575.     umul_optab->handlers[(int) SImode].insn_code = CODE_FOR_umulsi3;
  1576. #endif
  1577. #ifdef HAVE_umuldi3
  1578.   if (HAVE_umuldi3)
  1579.     umul_optab->handlers[(int) DImode].insn_code = CODE_FOR_umuldi3;
  1580. #endif
  1581. #ifdef HAVE_umulsf3
  1582.   if (HAVE_umulsf3)
  1583.     umul_optab->handlers[(int) SFmode].insn_code = CODE_FOR_umulsf3;
  1584. #endif
  1585. #ifdef HAVE_umuldf3
  1586.   if (HAVE_umuldf3)
  1587.     umul_optab->handlers[(int) DFmode].insn_code = CODE_FOR_umuldf3;
  1588. #endif
  1589.  
  1590. #ifdef UMULSI3_LIBCALL
  1591.   umul_optab->handlers[(int) SImode].lib_call = UMULSI3_LIBCALL;
  1592. #else
  1593.   umul_optab->handlers[(int) SImode].lib_call = "__umulsi3";
  1594. #endif
  1595.   umul_optab->handlers[(int) DImode].lib_call = "__umuldi3";
  1596.   umul_optab->handlers[(int) SFmode].lib_call = "__umulsf3";
  1597.   umul_optab->handlers[(int) DFmode].lib_call = "__umuldf3";
  1598.  
  1599. #ifdef HAVE_umulqihi3
  1600.   if (HAVE_umulqihi3)
  1601.     umul_widen_optab->handlers[(int) HImode].insn_code = CODE_FOR_umulqihi3;
  1602. #endif
  1603. #ifdef HAVE_umulhisi3
  1604.   if (HAVE_umulhisi3)
  1605.     umul_widen_optab->handlers[(int) SImode].insn_code = CODE_FOR_umulhisi3;
  1606. #endif
  1607. #ifdef HAVE_umulsidi3
  1608.   if (HAVE_umulsidi3)
  1609.     umul_widen_optab->handlers[(int) DImode].insn_code = CODE_FOR_umulsidi3;
  1610. #endif
  1611.  
  1612. #ifdef HAVE_divqi3
  1613.   if (HAVE_divqi3)
  1614.     sdiv_optab->handlers[(int) QImode].insn_code = CODE_FOR_divqi3;
  1615. #endif
  1616. #ifdef HAVE_divhi3
  1617.   if (HAVE_divhi3)
  1618.     sdiv_optab->handlers[(int) HImode].insn_code = CODE_FOR_divhi3;
  1619. #endif
  1620. #ifdef HAVE_divsi3
  1621.   if (HAVE_divsi3)
  1622.     sdiv_optab->handlers[(int) SImode].insn_code = CODE_FOR_divsi3;
  1623. #endif
  1624. #ifdef HAVE_divdi3
  1625.   if (HAVE_divdi3)
  1626.     sdiv_optab->handlers[(int) DImode].insn_code = CODE_FOR_divdi3;
  1627. #endif
  1628.  
  1629. #ifdef DIVSI3_LIBCALL
  1630.   sdiv_optab->handlers[(int) SImode].lib_call = DIVSI3_LIBCALL;
  1631. #else
  1632.   sdiv_optab->handlers[(int) SImode].lib_call = "__divsi3";
  1633. #endif
  1634.   sdiv_optab->handlers[(int) DImode].lib_call = "__divdi3";
  1635.  
  1636. #ifdef HAVE_udivqi3
  1637.   if (HAVE_udivqi3)
  1638.     udiv_optab->handlers[(int) QImode].insn_code = CODE_FOR_udivqi3;
  1639. #endif
  1640. #ifdef HAVE_udivhi3
  1641.   if (HAVE_udivhi3)
  1642.     udiv_optab->handlers[(int) HImode].insn_code = CODE_FOR_udivhi3;
  1643. #endif
  1644. #ifdef HAVE_udivsi3
  1645.   if (HAVE_udivsi3)
  1646.     udiv_optab->handlers[(int) SImode].insn_code = CODE_FOR_udivsi3;
  1647. #endif
  1648. #ifdef HAVE_udivdi3
  1649.   if (HAVE_udivdi3)
  1650.     udiv_optab->handlers[(int) DImode].insn_code = CODE_FOR_udivdi3;
  1651. #endif
  1652.  
  1653. #ifdef UDIVSI3_LIBCALL
  1654.   udiv_optab->handlers[(int) SImode].lib_call = UDIVSI3_LIBCALL;
  1655. #else
  1656.   udiv_optab->handlers[(int) SImode].lib_call = "__udivsi3";
  1657. #endif
  1658.   udiv_optab->handlers[(int) DImode].lib_call = "__udivdi3";
  1659.  
  1660. #ifdef HAVE_divmodqi4
  1661.   if (HAVE_divmodqi4)
  1662.     sdivmod_optab->handlers[(int) QImode].insn_code = CODE_FOR_divmodqi4;
  1663. #endif
  1664. #ifdef HAVE_divmodhi4
  1665.   if (HAVE_divmodhi4)
  1666.     sdivmod_optab->handlers[(int) HImode].insn_code = CODE_FOR_divmodhi4;
  1667. #endif
  1668. #ifdef HAVE_divmodsi4
  1669.   if (HAVE_divmodsi4)
  1670.     sdivmod_optab->handlers[(int) SImode].insn_code = CODE_FOR_divmodsi4;
  1671. #endif
  1672. #ifdef HAVE_divmoddi4
  1673.   if (HAVE_divmoddi4)
  1674.     sdivmod_optab->handlers[(int) DImode].insn_code = CODE_FOR_divmoddi4;
  1675. #endif
  1676.  
  1677. #ifdef HAVE_udivmodqi4
  1678.   if (HAVE_udivmodqi4)
  1679.     udivmod_optab->handlers[(int) QImode].insn_code = CODE_FOR_udivmodqi4;
  1680. #endif
  1681. #ifdef HAVE_udivmodhi4
  1682.   if (HAVE_udivmodhi4)
  1683.     udivmod_optab->handlers[(int) HImode].insn_code = CODE_FOR_udivmodhi4;
  1684. #endif
  1685. #ifdef HAVE_udivmodsi4
  1686.   if (HAVE_udivmodsi4)
  1687.     udivmod_optab->handlers[(int) SImode].insn_code = CODE_FOR_udivmodsi4;
  1688. #endif
  1689. #ifdef HAVE_udivmoddi4
  1690.   if (HAVE_udivmoddi4)
  1691.     udivmod_optab->handlers[(int) DImode].insn_code = CODE_FOR_udivmoddi4;
  1692. #endif
  1693.  
  1694. #ifdef HAVE_modqi3
  1695.   if (HAVE_modqi3)
  1696.     smod_optab->handlers[(int) QImode].insn_code = CODE_FOR_modqi3;
  1697. #endif
  1698. #ifdef HAVE_modhi3
  1699.   if (HAVE_modhi3)
  1700.     smod_optab->handlers[(int) HImode].insn_code = CODE_FOR_modhi3;
  1701. #endif
  1702. #ifdef HAVE_modsi3
  1703.   if (HAVE_modsi3)
  1704.     smod_optab->handlers[(int) SImode].insn_code = CODE_FOR_modsi3;
  1705. #endif
  1706. #ifdef HAVE_moddi3
  1707.   if (HAVE_moddi3)
  1708.     smod_optab->handlers[(int) DImode].insn_code = CODE_FOR_moddi3;
  1709. #endif
  1710.  
  1711. #ifdef MODSI3_LIBCALL
  1712.   smod_optab->handlers[(int) SImode].lib_call = MODSI3_LIBCALL;
  1713. #else
  1714.   smod_optab->handlers[(int) SImode].lib_call = "__modsi3";
  1715. #endif
  1716.   smod_optab->handlers[(int) DImode].lib_call = "__moddi3";
  1717.  
  1718. #ifdef HAVE_umodqi3
  1719.   if (HAVE_umodqi3)
  1720.     umod_optab->handlers[(int) QImode].insn_code = CODE_FOR_umodqi3;
  1721. #endif
  1722. #ifdef HAVE_umodhi3
  1723.   if (HAVE_umodhi3)
  1724.     umod_optab->handlers[(int) HImode].insn_code = CODE_FOR_umodhi3;
  1725. #endif
  1726. #ifdef HAVE_umodsi3
  1727.   if (HAVE_umodsi3)
  1728.     umod_optab->handlers[(int) SImode].insn_code = CODE_FOR_umodsi3;
  1729. #endif
  1730. #ifdef HAVE_umoddi3
  1731.   if (HAVE_umoddi3)
  1732.     umod_optab->handlers[(int) DImode].insn_code = CODE_FOR_umoddi3;
  1733. #endif
  1734.  
  1735. #ifdef UMODSI3_LIBCALL
  1736.   umod_optab->handlers[(int) SImode].lib_call = UMODSI3_LIBCALL;
  1737. #else
  1738.   umod_optab->handlers[(int) SImode].lib_call = "__umodsi3";
  1739. #endif
  1740.   umod_optab->handlers[(int) DImode].lib_call = "__umoddi3";
  1741.  
  1742. #ifdef HAVE_divsf3
  1743.   if (HAVE_divsf3)
  1744.     flodiv_optab->handlers[(int) SFmode].insn_code = CODE_FOR_divsf3;
  1745. #endif
  1746. #ifdef HAVE_divdf3
  1747.   if (HAVE_divdf3)
  1748.     flodiv_optab->handlers[(int) DFmode].insn_code = CODE_FOR_divdf3;
  1749. #endif
  1750.   flodiv_optab->handlers[(int) SFmode].lib_call = "__divsf3";
  1751.   flodiv_optab->handlers[(int) DFmode].lib_call = "__divdf3";
  1752.  
  1753. #ifdef HAVE_ftruncsf2
  1754.   if (HAVE_ftruncsf2)
  1755.     ftrunc_optab->handlers[(int) SFmode].insn_code = CODE_FOR_ftruncsf2;
  1756. #endif
  1757. #ifdef HAVE_ftruncdf2
  1758.   if (HAVE_ftruncdf2)
  1759.     ftrunc_optab->handlers[(int) DFmode].insn_code = CODE_FOR_ftruncdf2;
  1760. #endif
  1761.  
  1762. #ifdef HAVE_andqi3
  1763.   if (HAVE_andqi3)
  1764.     and_optab->handlers[(int) QImode].insn_code = CODE_FOR_andqi3;
  1765. #endif
  1766. #ifdef HAVE_andhi3
  1767.   if (HAVE_andhi3)
  1768.     and_optab->handlers[(int) HImode].insn_code = CODE_FOR_andhi3;
  1769. #endif
  1770. #ifdef HAVE_andsi3
  1771.   if (HAVE_andsi3)
  1772.     and_optab->handlers[(int) SImode].insn_code = CODE_FOR_andsi3;
  1773. #endif
  1774. #ifdef HAVE_anddi3
  1775.   if (HAVE_anddi3)
  1776.     and_optab->handlers[(int) DImode].insn_code = CODE_FOR_anddi3;
  1777. #endif
  1778.   and_optab->handlers[(int) DImode].lib_call = "__anddi3";
  1779.  
  1780. #ifdef HAVE_andcbqi3
  1781.   if (HAVE_andcbqi3)
  1782.     andcb_optab->handlers[(int) QImode].insn_code = CODE_FOR_andcbqi3;
  1783. #endif
  1784. #ifdef HAVE_andcbhi3
  1785.   if (HAVE_andcbhi3)
  1786.     andcb_optab->handlers[(int) HImode].insn_code = CODE_FOR_andcbhi3;
  1787. #endif
  1788. #ifdef HAVE_andcbsi3
  1789.   if (HAVE_andcbsi3)
  1790.     andcb_optab->handlers[(int) SImode].insn_code = CODE_FOR_andcbsi3;
  1791. #endif
  1792. #ifdef HAVE_andcbdi3
  1793.   if (HAVE_andcbdi3)
  1794.     andcb_optab->handlers[(int) DImode].insn_code = CODE_FOR_andcbdi3;
  1795. #endif
  1796.   andcb_optab->handlers[(int) DImode].lib_call = "__andcbdi3";
  1797.  
  1798. #ifdef HAVE_iorqi3
  1799.   if (HAVE_iorqi3)
  1800.     ior_optab->handlers[(int) QImode].insn_code = CODE_FOR_iorqi3;
  1801. #endif
  1802. #ifdef HAVE_iorhi3
  1803.   if (HAVE_iorhi3)
  1804.     ior_optab->handlers[(int) HImode].insn_code = CODE_FOR_iorhi3;
  1805. #endif
  1806. #ifdef HAVE_iorsi3
  1807.   if (HAVE_iorsi3)
  1808.     ior_optab->handlers[(int) SImode].insn_code = CODE_FOR_iorsi3;
  1809. #endif
  1810. #ifdef HAVE_iordi3
  1811.   if (HAVE_iordi3)
  1812.     ior_optab->handlers[(int) DImode].insn_code = CODE_FOR_iordi3;
  1813. #endif
  1814.   ior_optab->handlers[(int) DImode].lib_call = "__iordi3";
  1815.  
  1816. #ifdef HAVE_xorqi3
  1817.   if (HAVE_xorqi3)
  1818.     xor_optab->handlers[(int) QImode].insn_code = CODE_FOR_xorqi3;
  1819. #endif
  1820. #ifdef HAVE_xorhi3
  1821.   if (HAVE_xorhi3)
  1822.     xor_optab->handlers[(int) HImode].insn_code = CODE_FOR_xorhi3;
  1823. #endif
  1824. #ifdef HAVE_xorsi3
  1825.   if (HAVE_xorsi3)
  1826.     xor_optab->handlers[(int) SImode].insn_code = CODE_FOR_xorsi3;
  1827. #endif
  1828. #ifdef HAVE_xordi3
  1829.   if (HAVE_xordi3)
  1830.     xor_optab->handlers[(int) DImode].insn_code = CODE_FOR_xordi3;
  1831. #endif
  1832.   xor_optab->handlers[(int) DImode].lib_call = "__xordi3";
  1833.  
  1834. #ifdef HAVE_ashlqi3
  1835.   if (HAVE_ashlqi3)
  1836.     ashl_optab->handlers[(int) QImode].insn_code = CODE_FOR_ashlqi3;
  1837. #endif
  1838. #ifdef HAVE_ashlhi3
  1839.   if (HAVE_ashlhi3)
  1840.     ashl_optab->handlers[(int) HImode].insn_code = CODE_FOR_ashlhi3;
  1841. #endif
  1842. #ifdef HAVE_ashlsi3
  1843.   if (HAVE_ashlsi3)
  1844.     ashl_optab->handlers[(int) SImode].insn_code = CODE_FOR_ashlsi3;
  1845. #endif
  1846. #ifdef HAVE_ashldi3
  1847.   if (HAVE_ashldi3)
  1848.     ashl_optab->handlers[(int) DImode].insn_code = CODE_FOR_ashldi3;
  1849. #endif
  1850.   ashl_optab->handlers[(int) SImode].lib_call = "__ashlsi3";
  1851.   ashl_optab->handlers[(int) DImode].lib_call = "__ashldi3";
  1852.  
  1853. #ifdef HAVE_ashrqi3
  1854.   if (HAVE_ashrqi3)
  1855.     ashr_optab->handlers[(int) QImode].insn_code = CODE_FOR_ashrqi3;
  1856. #endif
  1857. #ifdef HAVE_ashrhi3
  1858.   if (HAVE_ashrhi3)
  1859.     ashr_optab->handlers[(int) HImode].insn_code = CODE_FOR_ashrhi3;
  1860. #endif
  1861. #ifdef HAVE_ashrsi3
  1862.   if (HAVE_ashrsi3)
  1863.     ashr_optab->handlers[(int) SImode].insn_code = CODE_FOR_ashrsi3;
  1864. #endif
  1865. #ifdef HAVE_ashrdi3
  1866.   if (HAVE_ashrdi3)
  1867.     ashr_optab->handlers[(int) DImode].insn_code = CODE_FOR_ashrdi3;
  1868. #endif
  1869.   ashr_optab->handlers[(int) SImode].lib_call = "__ashrsi3";
  1870.   ashr_optab->handlers[(int) DImode].lib_call = "__ashrdi3";
  1871.  
  1872. #ifdef HAVE_lshlqi3
  1873.   if (HAVE_lshlqi3)
  1874.     lshl_optab->handlers[(int) QImode].insn_code = CODE_FOR_lshlqi3;
  1875. #endif
  1876. #ifdef HAVE_lshlhi3
  1877.   if (HAVE_lshlhi3)
  1878.     lshl_optab->handlers[(int) HImode].insn_code = CODE_FOR_lshlhi3;
  1879. #endif
  1880. #ifdef HAVE_lshlsi3
  1881.   if (HAVE_lshlsi3)
  1882.     lshl_optab->handlers[(int) SImode].insn_code = CODE_FOR_lshlsi3;
  1883. #endif
  1884. #ifdef HAVE_lshldi3
  1885.   if (HAVE_lshldi3)
  1886.     lshl_optab->handlers[(int) DImode].insn_code = CODE_FOR_lshldi3;
  1887. #endif
  1888.   lshl_optab->handlers[(int) SImode].lib_call = "__lshlsi3";
  1889.   lshl_optab->handlers[(int) DImode].lib_call = "__lshldi3";
  1890.  
  1891. #ifdef HAVE_lshrqi3
  1892.   if (HAVE_lshrqi3)
  1893.     lshr_optab->handlers[(int) QImode].insn_code = CODE_FOR_lshrqi3;
  1894. #endif
  1895. #ifdef HAVE_lshrhi3
  1896.   if (HAVE_lshrhi3)
  1897.     lshr_optab->handlers[(int) HImode].insn_code = CODE_FOR_lshrhi3;
  1898. #endif
  1899. #ifdef HAVE_lshrsi3
  1900.   if (HAVE_lshrsi3)
  1901.     lshr_optab->handlers[(int) SImode].insn_code = CODE_FOR_lshrsi3;
  1902. #endif
  1903. #ifdef HAVE_lshrdi3
  1904.   if (HAVE_lshrdi3)
  1905.     lshr_optab->handlers[(int) DImode].insn_code = CODE_FOR_lshrdi3;
  1906. #endif
  1907.   lshr_optab->handlers[(int) SImode].lib_call = "__lshrsi3";
  1908.   lshr_optab->handlers[(int) DImode].lib_call = "__lshrdi3";
  1909.  
  1910. #ifdef HAVE_rotlqi3
  1911.   if (HAVE_rotlqi3)
  1912.     rotl_optab->handlers[(int) QImode].insn_code = CODE_FOR_rotlqi3;
  1913. #endif
  1914. #ifdef HAVE_rotlhi3
  1915.   if (HAVE_rotlhi3)
  1916.     rotl_optab->handlers[(int) HImode].insn_code = CODE_FOR_rotlhi3;
  1917. #endif
  1918. #ifdef HAVE_rotlsi3
  1919.   if (HAVE_rotlsi3)
  1920.     rotl_optab->handlers[(int) SImode].insn_code = CODE_FOR_rotlsi3;
  1921. #endif
  1922. #ifdef HAVE_rotldi3
  1923.   if (HAVE_rotldi3)
  1924.     rotl_optab->handlers[(int) DImode].insn_code = CODE_FOR_rotldi3;
  1925. #endif
  1926.   rotl_optab->handlers[(int) SImode].lib_call = "__rotlsi3";
  1927.   rotl_optab->handlers[(int) DImode].lib_call = "__rotldi3";
  1928.  
  1929. #ifdef HAVE_rotrqi3
  1930.   if (HAVE_rotrqi3)
  1931.     rotr_optab->handlers[(int) QImode].insn_code = CODE_FOR_rotrqi3;
  1932. #endif
  1933. #ifdef HAVE_rotrhi3
  1934.   if (HAVE_rotrhi3)
  1935.     rotr_optab->handlers[(int) HImode].insn_code = CODE_FOR_rotrhi3;
  1936. #endif
  1937. #ifdef HAVE_rotrsi3
  1938.   if (HAVE_rotrsi3)
  1939.     rotr_optab->handlers[(int) SImode].insn_code = CODE_FOR_rotrsi3;
  1940. #endif
  1941. #ifdef HAVE_rotrdi3
  1942.   if (HAVE_rotrdi3)
  1943.     rotr_optab->handlers[(int) DImode].insn_code = CODE_FOR_rotrdi3;
  1944. #endif
  1945.   rotr_optab->handlers[(int) SImode].lib_call = "__rotrsi3";
  1946.   rotr_optab->handlers[(int) DImode].lib_call = "__rotrdi3";
  1947.  
  1948. #ifdef HAVE_negqi2
  1949.   if (HAVE_negqi2)
  1950.     neg_optab->handlers[(int) QImode].insn_code = CODE_FOR_negqi2;
  1951. #endif
  1952. #ifdef HAVE_neghi2
  1953.   if (HAVE_neghi2)
  1954.     neg_optab->handlers[(int) HImode].insn_code = CODE_FOR_neghi2;
  1955. #endif
  1956. #ifdef HAVE_negsi2
  1957.   if (HAVE_negsi2)
  1958.     neg_optab->handlers[(int) SImode].insn_code = CODE_FOR_negsi2;
  1959. #endif
  1960. #ifdef HAVE_negdi2
  1961.   if (HAVE_negdi2)
  1962.     neg_optab->handlers[(int) DImode].insn_code = CODE_FOR_negdi2;
  1963. #endif
  1964. #ifdef HAVE_negsf2
  1965.   if (HAVE_negsf2)
  1966.     neg_optab->handlers[(int) SFmode].insn_code = CODE_FOR_negsf2;
  1967. #endif
  1968. #ifdef HAVE_negdf2
  1969.   if (HAVE_negdf2)
  1970.     neg_optab->handlers[(int) DFmode].insn_code = CODE_FOR_negdf2;
  1971. #endif
  1972.   neg_optab->handlers[(int) SImode].lib_call = "__negsi2"; 
  1973.   neg_optab->handlers[(int) DImode].lib_call = "__negdi2";
  1974.   neg_optab->handlers[(int) SFmode].lib_call = "__negsf2";
  1975.   neg_optab->handlers[(int) DFmode].lib_call = "__negdf2";
  1976.  
  1977. #ifdef HAVE_absqi2
  1978.   if (HAVE_absqi2)
  1979.     abs_optab->handlers[(int) QImode].insn_code = CODE_FOR_absqi2;
  1980. #endif
  1981. #ifdef HAVE_abshi2
  1982.   if (HAVE_abshi2)
  1983.     abs_optab->handlers[(int) HImode].insn_code = CODE_FOR_abshi2;
  1984. #endif
  1985. #ifdef HAVE_abssi2
  1986.   if (HAVE_abssi2)
  1987.     abs_optab->handlers[(int) SImode].insn_code = CODE_FOR_abssi2;
  1988. #endif
  1989. #ifdef HAVE_absdi2
  1990.   if (HAVE_absdi2)
  1991.     abs_optab->handlers[(int) DImode].insn_code = CODE_FOR_absdi2;
  1992. #endif
  1993. #ifdef HAVE_abssf2
  1994.   if (HAVE_abssf2)
  1995.     abs_optab->handlers[(int) SFmode].insn_code = CODE_FOR_abssf2;
  1996. #endif
  1997. #ifdef HAVE_absdf2
  1998.   if (HAVE_absdf2)
  1999.     abs_optab->handlers[(int) DFmode].insn_code = CODE_FOR_absdf2;
  2000. #endif
  2001.   /* No library calls here!  If there is no abs instruction,
  2002.      expand_expr will generate a conditional negation.  */
  2003.  
  2004. #ifdef HAVE_one_cmplqi2
  2005.   if (HAVE_one_cmplqi2)
  2006.     one_cmpl_optab->handlers[(int) QImode].insn_code = CODE_FOR_one_cmplqi2;
  2007. #endif
  2008. #ifdef HAVE_one_cmplhi2
  2009.   if (HAVE_one_cmplhi2)
  2010.     one_cmpl_optab->handlers[(int) HImode].insn_code = CODE_FOR_one_cmplhi2;
  2011. #endif
  2012. #ifdef HAVE_one_cmplsi2
  2013.   if (HAVE_one_cmplsi2)
  2014.     one_cmpl_optab->handlers[(int) SImode].insn_code = CODE_FOR_one_cmplsi2;
  2015. #endif
  2016. #ifdef HAVE_one_cmpldi2
  2017.   if (HAVE_one_cmpldi2)
  2018.     one_cmpl_optab->handlers[(int) DImode].insn_code = CODE_FOR_one_cmpldi2;
  2019. #endif
  2020.   one_cmpl_optab->handlers[(int) SImode].lib_call = "__one_cmplsi2"; 
  2021.   one_cmpl_optab->handlers[(int) DImode].lib_call = "__one_cmpldi2";
  2022.  
  2023. #ifdef HAVE_ffsqi2
  2024.   if (HAVE_ffsqi2)
  2025.     ffs_optab->handlers[(int) QImode].insn_code = CODE_FOR_ffsqi2;
  2026. #endif
  2027. #ifdef HAVE_ffshi2
  2028.   if (HAVE_ffshi2)
  2029.     ffs_optab->handlers[(int) HImode].insn_code = CODE_FOR_ffshi2;
  2030. #endif
  2031. #ifdef HAVE_ffssi2
  2032.   if (HAVE_ffssi2)
  2033.     ffs_optab->handlers[(int) SImode].insn_code = CODE_FOR_ffssi2;
  2034. #endif
  2035. #ifdef HAVE_ffsdi2
  2036.   if (HAVE_ffsdi2)
  2037.     ffs_optab->handlers[(int) DImode].insn_code = CODE_FOR_ffsdi2;
  2038. #endif
  2039.   ffs_optab->handlers[(int) SImode].lib_call = "ffs"; 
  2040.  
  2041. #ifdef HAVE_movqi
  2042.   if (HAVE_movqi)
  2043.     mov_optab->handlers[(int) QImode].insn_code = CODE_FOR_movqi;
  2044. #endif
  2045. #ifdef HAVE_movhi
  2046.   if (HAVE_movhi)
  2047.     mov_optab->handlers[(int) HImode].insn_code = CODE_FOR_movhi;
  2048. #endif
  2049. #ifdef HAVE_movsi
  2050.   if (HAVE_movsi)
  2051.     mov_optab->handlers[(int) SImode].insn_code = CODE_FOR_movsi;
  2052. #endif
  2053. #ifdef HAVE_movdi
  2054.   if (HAVE_movdi)
  2055.     mov_optab->handlers[(int) DImode].insn_code = CODE_FOR_movdi;
  2056. #endif
  2057. #ifdef HAVE_movti
  2058.   if (HAVE_movti)
  2059.     mov_optab->handlers[(int) TImode].insn_code = CODE_FOR_movti;
  2060. #endif
  2061. #ifdef HAVE_movsf
  2062.   if (HAVE_movsf)
  2063.     mov_optab->handlers[(int) SFmode].insn_code = CODE_FOR_movsf;
  2064. #endif
  2065. #ifdef HAVE_movdf
  2066.   if (HAVE_movdf)
  2067.     mov_optab->handlers[(int) DFmode].insn_code = CODE_FOR_movdf;
  2068. #endif
  2069. #ifdef HAVE_movtf
  2070.   if (HAVE_movtf)
  2071.     mov_optab->handlers[(int) TFmode].insn_code = CODE_FOR_movtf;
  2072. #endif
  2073.  
  2074. #ifdef HAVE_movstrictqi
  2075.   if (HAVE_movstrictqi)
  2076.     movstrict_optab->handlers[(int) QImode].insn_code = CODE_FOR_movstrictqi;
  2077. #endif
  2078. #ifdef HAVE_movstricthi
  2079.   if (HAVE_movstricthi)
  2080.     movstrict_optab->handlers[(int) HImode].insn_code = CODE_FOR_movstricthi;
  2081. #endif
  2082. #ifdef HAVE_movstrictsi
  2083.   if (HAVE_movstrictsi)
  2084.     movstrict_optab->handlers[(int) SImode].insn_code = CODE_FOR_movstrictsi;
  2085. #endif
  2086. #ifdef HAVE_movstrictdi
  2087.   if (HAVE_movstrictdi)
  2088.     movstrict_optab->handlers[(int) DImode].insn_code = CODE_FOR_movstrictdi;
  2089. #endif
  2090.  
  2091. #ifdef HAVE_cmpqi
  2092.   if (HAVE_cmpqi)
  2093.     cmp_optab->handlers[(int) QImode].insn_code = CODE_FOR_cmpqi;
  2094. #endif
  2095. #ifdef HAVE_cmphi
  2096.   if (HAVE_cmphi)
  2097.     cmp_optab->handlers[(int) HImode].insn_code = CODE_FOR_cmphi;
  2098. #endif
  2099. #ifdef HAVE_cmpsi
  2100.   if (HAVE_cmpsi)
  2101.     cmp_optab->handlers[(int) SImode].insn_code = CODE_FOR_cmpsi;
  2102. #endif
  2103. #ifdef HAVE_cmpdi
  2104.   if (HAVE_cmpdi)
  2105.     cmp_optab->handlers[(int) DImode].insn_code = CODE_FOR_cmpdi;
  2106. #endif
  2107. #ifdef HAVE_cmpsf
  2108.   if (HAVE_cmpsf)
  2109.     cmp_optab->handlers[(int) SFmode].insn_code = CODE_FOR_cmpsf;
  2110. #endif
  2111. #ifdef HAVE_cmpdf
  2112.   if (HAVE_cmpdf)
  2113.     cmp_optab->handlers[(int) DFmode].insn_code = CODE_FOR_cmpdf;
  2114. #endif
  2115. #ifdef HAVE_tstqi
  2116.   if (HAVE_tstqi)
  2117.     tst_optab->handlers[(int) QImode].insn_code = CODE_FOR_tstqi;
  2118. #endif
  2119. #ifdef HAVE_tsthi
  2120.   if (HAVE_tsthi)
  2121.     tst_optab->handlers[(int) HImode].insn_code = CODE_FOR_tsthi;
  2122. #endif
  2123. #ifdef HAVE_tstsi
  2124.   if (HAVE_tstsi)
  2125.     tst_optab->handlers[(int) SImode].insn_code = CODE_FOR_tstsi;
  2126. #endif
  2127. #ifdef HAVE_tstdi
  2128.   if (HAVE_tstdi)
  2129.     tst_optab->handlers[(int) DImode].insn_code = CODE_FOR_tstdi;
  2130. #endif
  2131. #ifdef HAVE_tstsf
  2132.   if (HAVE_tstsf)
  2133.     tst_optab->handlers[(int) SFmode].insn_code = CODE_FOR_tstsf;
  2134. #endif
  2135. #ifdef HAVE_tstdf
  2136.   if (HAVE_tstdf)
  2137.     tst_optab->handlers[(int) DFmode].insn_code = CODE_FOR_tstdf;
  2138. #endif
  2139.   /* Comparison libcalls for integers MUST come in pairs, signed/unsigned.  */
  2140.   cmp_optab->handlers[(int) DImode].lib_call = "__cmpdi2";
  2141.   ucmp_optab->handlers[(int) DImode].lib_call = "__ucmpdi2";
  2142.   cmp_optab->handlers[(int) SFmode].lib_call = "__cmpsf2";
  2143.   cmp_optab->handlers[(int) DFmode].lib_call = "__cmpdf2";
  2144.  
  2145. #if HAVE_beq
  2146.   if (HAVE_beq)
  2147.     bcc_gen_fctn[(int) EQ] = gen_beq;
  2148. #endif
  2149. #if HAVE_bne
  2150.   if (HAVE_bne)
  2151.     bcc_gen_fctn[(int) NE] = gen_bne;
  2152. #endif
  2153. #if HAVE_bgt
  2154.   if (HAVE_bgt)
  2155.     bcc_gen_fctn[(int) GT] = gen_bgt;
  2156. #endif
  2157. #if HAVE_bge
  2158.   if (HAVE_bge)
  2159.     bcc_gen_fctn[(int) GE] = gen_bge;
  2160. #endif
  2161. #if HAVE_bgtu
  2162.   if (HAVE_bgtu)
  2163.     bcc_gen_fctn[(int) GTU] = gen_bgtu;
  2164. #endif
  2165. #if HAVE_bgeu
  2166.   if (HAVE_bgeu)
  2167.     bcc_gen_fctn[(int) GEU] = gen_bgeu;
  2168. #endif
  2169. #if HAVE_blt
  2170.   if (HAVE_blt)
  2171.     bcc_gen_fctn[(int) LT] = gen_blt;
  2172. #endif
  2173. #if HAVE_ble
  2174.   if (HAVE_ble)
  2175.     bcc_gen_fctn[(int) LE] = gen_ble;
  2176. #endif
  2177. #if HAVE_bltu
  2178.   if (HAVE_bltu)
  2179.     bcc_gen_fctn[(int) LTU] = gen_bltu;
  2180. #endif
  2181. #if HAVE_bleu
  2182.   if (HAVE_bleu)
  2183.     bcc_gen_fctn[(int) LEU] = gen_bleu;
  2184. #endif
  2185.  
  2186. #if HAVE_seq
  2187.   if (HAVE_seq)
  2188.     setcc_gen_fctn[(int) EQ] = gen_seq;
  2189. #endif
  2190. #if HAVE_sne
  2191.   if (HAVE_sne)
  2192.     setcc_gen_fctn[(int) NE] = gen_sne;
  2193. #endif
  2194. #if HAVE_sgt
  2195.   if (HAVE_sgt)
  2196.     setcc_gen_fctn[(int) GT] = gen_sgt;
  2197. #endif
  2198. #if HAVE_sge
  2199.   if (HAVE_sge)
  2200.     setcc_gen_fctn[(int) GE] = gen_sge;
  2201. #endif
  2202. #if HAVE_sgtu
  2203.   if (HAVE_sgtu)
  2204.     setcc_gen_fctn[(int) GTU] = gen_sgtu;
  2205. #endif
  2206. #if HAVE_sgeu
  2207.   if (HAVE_sgeu)
  2208.     setcc_gen_fctn[(int) GEU] = gen_sgeu;
  2209. #endif
  2210. #if HAVE_slt
  2211.   if (HAVE_slt)
  2212.     setcc_gen_fctn[(int) LT] = gen_slt;
  2213. #endif
  2214. #if HAVE_sle
  2215.   if (HAVE_sle)
  2216.     setcc_gen_fctn[(int) LE] = gen_sle;
  2217. #endif
  2218. #if HAVE_sltu
  2219.   if (HAVE_sltu)
  2220.     setcc_gen_fctn[(int) LTU] = gen_sltu;
  2221. #endif
  2222. #if HAVE_sleu
  2223.   if (HAVE_sleu)
  2224.     setcc_gen_fctn[(int) LEU] = gen_sleu;
  2225. #endif
  2226. }
  2227.